package com.heima.apis.article;

import com.heima.model.article.dtos.ArticleCommonDto;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.comment.dtos.ALLCommentListDto;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author JianKang
 * @create 2023-10-21 17:20
 */
@FeignClient(value = "leadnews-article")
public interface IArticleClient {

    @PostMapping("/api/v1/article/save")
    ResponseResult saveArticle(@RequestBody ArticleDto dto);

    @GetMapping("/api/v1/article/update_views/{id}")
    ResponseResult updateViews(@PathVariable Long id);

    @GetMapping("/api/v1/article/update_likes/{id}")
    ResponseResult updateLikes(@PathVariable Long id);

    @PostMapping("/api/v1/article/find_news_comments")
    ResponseResult findNewsComments(@RequestBody ALLCommentListDto dto);

    @PostMapping("/api/v1/article/update_comment_status")
    ResponseResult updateCommentStatus(@RequestBody ArticleCommonDto dto);

}
